//
// StringTestReplacing.m -- test out the String class' Replacing category
//		Written by Don Yacktman Copyright (c) 1994 by Don Yacktman.
//				Version 1.0.  All rights reserved.
//
//		This notice may not be removed from this source code.
//
//	This program is included in the MiscKit by permission from the author
//	and its use is governed by the MiscKit license, found in the file
//	"LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
//	for a list of all applicable permissions and restrictions.
//	

#define NUMREPLSTRINGS 4
void testMiscStringReplacing()
{
	id string[NUMREPLSTRINGS]; int i;

	printf("***** Testing MiscStringReplacing category\n");

// Test MiscStringReplacing.m methods:
	// The following are covers for other methods and aren't tested here,
	// though for completeness they probably ought to be:
	//
	// - replaceFrom:(int)start length:(int)len with:(const char *)aString
	// - replaceFrom:(int)start to:(int)end with:(const char *)aString
	// - replaceFrom:(int)start length:(int)len withString:(id)sender
	// - replaceFrom:(int)start to:(int)end withString:(id)sender
	// - replace:(const char *)subString withString:(id)sender
	// - replaceFrom:(int)start length:(int)len withChar:(char)aChar
	// - replaceFrom:(int)start to:(int)end withChar:(char)aChar
	// - replaceEveryOccurrenceOfChars:(const char *)aString
	//			with:(const char *)replaceString
	// - replaceEveryOccurrenceOfChars:(const char *)aString
	//			withChar:(char)replaceChar
	// - replaceEveryOccurrenceOfChars:(const char *)aString
	//			withString:(id)sender
	// - replaceEveryOccurrenceOfChars:(const char *)aString
	//			withString:(id)sender caseSensitive:(BOOL)sense
	// - replaceEveryOccurrenceOfChar:(char)aChar with:(const char *)aString
	// - replaceEveryOccurrenceOfChar:(char)aChar withString:(id)sender
	// - replaceEveryOccurrenceOfChar:(char)aChar
	//			withString:(id)sender caseSensitive:(BOOL)sense
	// - replaceEveryOccurrenceOfChar:(char)aChar withChar:(char)replaceChar

	string[0] = [MiscString new];
	string[1] = [MiscString newWithString:"This is a non-null test string."];
	string[2] = [MiscString newWithString:"This is a test, a test it is."];
	string[3] = [MiscString newWithString:"Q"];
	
	printf("The strings for these tests are:\n", i, string[i]);
	for (i=0; i<NUMREPLSTRINGS; i++) {
		printf("String #%d:  \"%d\"\n", i, string[i]);
	}
// Test - replaceCharAt:(int)index withChar:(char)aChar

// Test - replace:(const char *)subString with:(const char *)newString

// Test - replaceEveryOccurrenceOfChars:(const char *)aString
//				with:(const char *)replaceString caseSensitive:(BOOL)sense

// Test - replaceEveryOccurrenceOfChars:(const char *)aString
//				withChar:(char)replaceChar caseSensitive:(BOOL)sense

// Test - replaceEveryOccurrenceOfChar:(char)aChar with:(const char *)aString
//				caseSensitive:(BOOL)sense

// Test - replaceEveryOccurrenceOfChar:(char)aChar withChar:(char)replaceChar
//				caseSensitive:(BOOL)sense

	for (i=0; i<NUMREPLSTRINGS; i++) {
		[string[i] free]
	}
}

